//string 子串获取
#include <iostream>
#include <string>

using namespace std;

int main()
{
    string s1;
    s1="Hello woooorld";
    //从索引7开始提取4个字符
    string subStr=s1.substr(7,4);
    cout<<subStr<<endl;

    string s2="HelloNUAAWorld!";
    int pos=s2.find("NUAA");
    string s3=s2.substr(0,pos);//从开头到pos
    string s4=s2.substr(pos+4);//从pos+4到结尾
    cout<<s3<<' '<<s4<<endl;

    return 0;
}